Skip to content

Conversation

@nayonsoso
Copy link
Collaborator

관련 이슈

작업 내용

실패하는 테스트 코드들을 수정했습니다.

  1. TINYINT(1)에 대해서 MySQL과 H2의 환경이 달라 문제가 발생했었습니다.
    문제 해결 과정을 디스커션에 정리해두었습니다 H2와 MySQL의 TINYINT 타입 불일치 #117
  2. CommentRepository.findCommentTreeByPostId()의 단위 테스트 코드가 profile 변경에 의해 깨졌습니다.
    H2은 MySQL과 달리 RECURSIVE 문이 동작하지 않으므로 MySQL을 사용하기 위해서 local 로 profile을 지정해놨는데,
    이 profile 이름을 dev 로 바꿈에 따라서 깨졌던 것입니다.
    ActiveProfile을 dev 로 바꿔 테스트 통과시켰습니다.
    (하지만 이렇게 profile이나 db의 종류에 의존하는 테스트코드가 베스트라고 생각하진 않습니다..😔)

특이 사항

위 두가지 문제 모두, test 환경에서는 H2을, 개발 환경에서는 MySQL을 사용하기에 생기는 문제입니다.
이를 해결하기 위해서 따로 이슈를 팠으며, #119
이 PR에서는 우선 테스트 코드가 다 통과하게 하는 것이 목적이었기에 여기까지 하고 PR 올립니다!

리뷰 요구사항 (선택)

Copy link
Member

@wibaek wibaek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nayonsoso nayonsoso merged commit 874bdc3 into main Dec 16, 2024
@nayonsoso nayonsoso deleted the fix/pass-all-tests branch February 15, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants